package com.example.demo.Server.Imp;


import com.example.demo.DAO.StatisticsDao;
import com.example.demo.Entity.Statistics;

import com.example.demo.Server.statisticsServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
@Primary
public class StatisticsServlerImp implements statisticsServer {
    @Autowired
    StatisticsDao dao;

    public List<Statistics> findAll(){
        return dao.findAll();
    }

    @Override
    public List<Statistics> fuzzyQuery(String query) {
        return dao.fuzzyQuery(query);
    }

    @Override
    public Integer deleteStatistics(Integer deleteId) {
        return dao.deleteStatistics(deleteId);
    }

    @Override
    public void addStatistics(Statistics s) {
         dao.addStatistics(s);
    }

    @Override
    public Integer updateStatistics(Statistics statistics) {
        return dao.updateStatistics(statistics);
    }

    @Override
    public String findID(String date) {
        return dao.findID(date);
    }

    @Override
    public Statistics findByID(String _id) {
        return dao.findByID(_id);
    }
}
